package cn.edu.scau.cmi.liuyonglin.chapter9;

import java.util.StringTokenizer;

public class ComputePice {
	public double compute(String str,String sign) {
		double result = 0,digitItem = 0;
		StringTokenizer fenxiOne = new StringTokenizer(str,sign);
		while(fenxiOne.hasMoreTokens()) {
			String s = fenxiOne.nextToken();
			digitItem = Double.parseDouble(s);
			result += digitItem;
		}
		return result;
	}
}
